<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <!-- import CSS -->
  <link rel="stylesheet" href="/css/eui.css">
  <script src="/js/vue.min.js"></script>
  <!-- import JavaScript -->
  <script src="/js/eui.js"></script>
  <script src="/js/axios.min.js"></script>
  <style>
    .el-page-header__content{
      color: white;
    }
  </style>
</head>
<body>
<div id="app">
  <el-page-header style="background-color: #820C0C; color: white;height: 60px;line-height: 60px;font-weight: bold" @back="goBack" content="添加商品页面">
  </el-page-header>
  <!--分割线-->
  <el-divider></el-divider>
  <el-card>
    <el-form>
      <el-form-item label="品牌分类" label-width="100px">
        <el-select v-model="product.brandId" placeholder="请选择品牌分类">
          <el-option v-for="brand in brandArr" :value="brand.id" :label="brand.brandName"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="商品分类" label-width="100px">
        <el-select v-model="product.categoryId" placeholder="请选择商品分类">
          <el-option v-for="category in categoryArr" :value="category.id" :label="category.categoryName"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="商品标题" label-width="100px">
        <el-input v-model="product.title"></el-input>
      </el-form-item>
      <el-form-item label="商品短标题" label-width="100px">
        <el-input v-model="product.shortTitle"></el-input>
      </el-form-item>
      <el-form-item label="商品内容" prop="desc" label-width="100px">
        <el-input type="textarea" v-model="product.content"></el-input>
      </el-form-item>
      <el-form-item label="tags" label-width="100px">
        <el-input v-model="product.tags"></el-input>
      </el-form-item>
      <el-form-item label="商品图片" label-width="100px">
        <!--选择图片组件开始-->
        <!--limit=1设置只能选择一张图片-->
        <el-upload
                limit="1"
                action="/admin/upload"
                name="picFile"
                list-type="picture-card"
                :on-preview="handlePictureCardPreview"
                :on-success="handleSuccess"
                :on-exceed="exceed"
                :on-remove="handleRemove">
          <i class="el-icon-plus"></i>
        </el-upload>
        <el-dialog :visible.sync="dialogVisible">
          <img width="100%" :src="dialogImageUrl" alt="">
        </el-dialog>
        <!--选择图片组件结束-->
      </el-form-item>
      <el-form-item>
        <el-button @click="send" type="success">发布商品</el-button>
      </el-form-item>

    </el-form>
  </el-card>
</div>
</body>

<script src="/js/product.js"></script>
</html>